import request from '@/config/axios'

// 试题题库题目关联 VO
export interface QuestionBankVO {
  id: number // 主键
  bankId: string // 题库id
  questionId: number // 试题id
}

// 试题题库题目关联 API
export const QuestionBankApi = {
  // 查询试题题库题目关联分页
  getQuestionBankPage: async (params: any) => {
    return await request.get({ url: `/exam/question-bank/page`, params })
  },

  // 查询试题题库题目关联详情
  getQuestionBank: async (id: number) => {
    return await request.get({ url: `/exam/question-bank/get?id=` + id })
  },

  // 新增试题题库题目关联
  createQuestionBank: async (data: QuestionBankVO) => {
    return await request.post({ url: `/exam/question-bank/create`, data })
  },

  // 修改试题题库题目关联
  updateQuestionBank: async (data: QuestionBankVO) => {
    return await request.put({ url: `/exam/question-bank/update`, data })
  },

  // 删除试题题库题目关联
  deleteQuestionBank: async (id: number) => {
    return await request.delete({ url: `/exam/question-bank/delete?id=` + id })
  },

  // 导出试题题库题目关联 Excel
  exportQuestionBank: async (params) => {
    return await request.download({ url: `/exam/question-bank/export-excel`, params })
  },
}